package org.ouwh.oowiki.http;

import javax.servlet.http.HttpServletResponse;

import org.ouwh.fw.model.data.Struct;
import org.ouwh.oowiki.GlobalConstants;

public class StructPresenter {
	public void present(HttpServletResponse response, MyResponse myResponse)
			throws Exception {
		Struct results = myResponse.getResults();
		StringBuffer xml = new StringBuffer();
		xml.append("<?xml version=\"1.0\" encoding=\"");
		xml.append(GlobalConstants.CHAR_SET);
		xml.append("\" ?>\n<oowiki-response>\n");
		xml.append(results.toString());
		xml.append("\n</oowiki-response>");
		response.setContentType("text/html;charset=" + GlobalConstants.CHAR_SET);
		response.getOutputStream().write(
				xml.toString().getBytes(GlobalConstants.CHAR_SET));
		response.flushBuffer();
	}
}
